import paramiko
import getpass
import time

Chanenel=paramiko.SSHClient()
Chanenel.set_missing_host_key_policy(paramiko.AutoAddPolicy())
Chanenel.connect(hostname=input("hostname:"),
                username=input("username:"),
                password=getpass.getpass("password:"),
                look_for_keys=False,
                allow_agent=False)
shell=Chanenel.invoke_shell()
print(shell.recv(5000).decode('utf-8'))
while 1:
    x=input("命令:")
    shell.send(x+'\n')
    time.sleep(1)
    print(shell.recv(5000).decode('utf-8'))
